import {
	get,
	post,
	put,
	del,
	request
} from "./http.js";

const Api = {
	Yingshi:{
		Token:()=>get(`/api/yingshi/token`)
	},
	Thumbsup:{
		Thumbsup:(type,id,params)=>post(`/api/thumbsup/${type}/${id}`, params),
	},
	Followed:{
		Follow(params) {
			return post("/api/my/follow", params);
		},
		DelFollow(params) {
			return del("/api/my/unfollow", params);
		},
	},
	Login: {
		Session: (params) => post(`/api/login/mini/open/session`, params),
		Mobile: (params) => post(`/api/login/mini/open/mobile`, params),
		Silent: (params) => post(`/api/login/mini/open/silent`, params),
	},
	Decorate: {
		List: (params) => post(`/company/api/decorate`, params),
		List_C: (params) => get(`/api/decorate`, params),
		Add: (params) => post(`/company/api/decorate/store`, params),
		Detail: (id) => get(`/company/api/decorate/${id}/detail`),
		Detail_C: (id) => get(`/api/decorate/${id}/detail`),
		Del: (id) => del(`/company/api/decorate/${id}`),
		Info: (id) => get(`/company/api/decorate/${id}`),
		Update: (id, params) => put(`/company/api/decorate/${id}`, params),
		Process: {
			Sort: (params) => put(`/company/api/process/sort`, params),
			Del: (decorate_id, id) => del(`/company/api/decorate/${decorate_id}/process/${id}`),
			Add: (id, params) => post(`/company/api/decorate/${id}/process/store`, params)
		}
	},
	Administrator: {
		List: (params) => get(`/company/api/administrator`, params),
		Del: (id) => del(`/company/api/administrator/${id}`),
		Add: (params) => post(`/company/api/administrator/${params.user_id}`, params),
		Detail:(id)=> get(`/company/api/administrator/${id}`),
		Update: (id, params) => put(`/company/api/administrator/${id}`, params),
	},

	My: {
		Detail: (params) => get(`/api/my/detail`, params),
		Authorizer: {
			List: (params) => post(`/company/api/my/authorizer`, params)
		},
		Active: (params) => post(`/company/api/my/submission`, params),
		Home:()=>get(`/api/my/home`),
		Followings(params) {
			return post("/api/my/followings", params);
		},
	},
	Aliyun: {
		Image: {
			Create: (params) => post(`/company/api/aliyun/image/token/create`, params)
		},
		Video: {
			Create: (params) => post(`/company/api/aliyun/video/token/create`, params)
		}
	},
	Video: {
		Add: (params) => post(`/company/api/video/store`, params)
	},
	Active: {
		Add: (params) => post(`/company/api/activity/store`, params),
		List: (id, params) => get(`/company/api/decorate/${id}/activity`, params),
		List_C: (id, params) => get(`/api/decorate/${id}/activity`, params),
		AllList:(params)=>post(`/api/activity`,params),
		Del: (id) => del(`/company/api/activity/${id}`),
		Verify: (id, params) => put(`/company/api/activity/${id}/verify`, params),
		Detail: (id) => get(`/company/api/activity/${id}/detail`),
		upDate: (id, params) => put(`/company/api/activity/${id}`, params),
		Latest:(params)=>get(`/company/api/activity/decorate/latest`,params),
	},
	Compound: {
		Project: {
			List: (params) => get(`/company/api/aliyun/clip/list`, params),
			Detail: (params) => get(`/company/api/aliyun/clip`, params),
		},
		Create: (params) => post(`/company/api/aliyun/clip/video/create`, params)
	},
	Video: {
		Add: (params) => post(`/company/api/video/store`, params),
		Del: (id) => del(`/company/api/video/${id}`),
	},
	Image: {
		Add: (params) => post(`/company/api/image/store`, params),
		Del: (id) => del(`/company/api/image/${id}`),
		List:(params) =>post(`/company/api/media/image`,params),
		DelMedia: (id) => del(`/company/api/media/image/${id}`),
		Update:(id,params)=> put(`/company/api/image/${id}`, params),
	},
	Home: {
		List: (params) => get(`/api/home`)
	},
	Style: {
		List: (params) => get(`/api/style`,params),
		Add: (params) => post(`/company/api/style/store`, params),
		Del: (id) => del(`/company/api/style/${id}`),
		Info: (id) => get(`/company/api/style/${id}`),
		Update: (id, params) => put(`/company/api/style/${id}`, params),
	},
	Edit: {
		Nickname: (params) => post(`/api/my/detail/nickname`, params),
	},
	Shop: {
		All: () => get(`/company/api/company/all`),
		Active:(params)=>post(`/company/api/activity`,params),
		Detail:(id)=>get(`/company/api/company/detail`),
		Detail_C:(id)=>get(`/api/company/detail`),
		Update:(params)=>put(`/company/api/company`,params),
		Members:{
			List:(params)=>get(`/api/company/member`,params),
		}
	},
	Process: {
		List: (params) => post(`/api/process`, params),
		Sort: (params) => put(`/company/api/process/sort`, params),
		Del: (id) => del(`/company/api/process/${id}`),
		Add: (params) => post(`/company/api/process/store`, params)
	},
	Administrator_role: {
		List: (params) => post(`/company/api/administrator_role`, params),
		Del: (id) => del(`/company/api/administrator_role/${id}`),
		Detail: (id) => get(`/company/api/administrator_role/${id}`),
		Info: () => get(`/company/api/administrator_role/add`),
		Add: (params) => post(`/company/api/administrator_role/store`, params),
		Update: (id, params) => put(`/company/api/administrator_role/${id}`, params),
	},
	Members: {
		List(params) {
			return post("/company/api/member", params);
		},
	},
	Relative:{
		Add:(params)=>post(`/api/my/relative/store`,params),
		List:(params)=>post(`/api/my/relative`,params),
	},
	User:{
		Relative:(id,params)=>get(`/api/user/${id}/relative`,params),
	},
	Comment:{
		List:(id,params)=>get(`/api/comment/activity/${id}`,params),
		Add:(id,params)=>post(`/api/comment/activity/${id}/submit`,params),
		ListReply:(id,params)=>get(`/api/comment/${id}/answer`,params),
	},
	Order:{
		postOrder:(params)=>post(`/company/api/order/payment/wechat/mini`,params),
		
	}
};

export default Api;